package java8;

import java.util.Comparator;

public class lamdba {

    public void test1(){
        Runnable r1 = new Runnable() {
            @Override
            public void run() {
                System.out.println("11");
            }
        };
        r1.run();

        Runnable r2 = () -> System.out.println("222");
        r2.run();

    }

    public void test2(){
        Comparator<Integer> com = new Comparator<Integer>() {
            @Override
            public int compare(Integer o1, Integer o2) {
                return o1 - o2;
            }
        };
        Comparator<Integer> com2 = Integer::compare;

    }

}
